package com.hxzrz111.java8.lambda;

/**
 * 使用lambda 启动线程
 */
public class LambdaRunnable {

    public static void main(String[] args) {
        // Java8 之前
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("Before Java8, too much code for too little to do");
            }
        }).start();

        // Java8
        new Thread(() -> System.out.println("In Java8, Lambda expression rocks !!")).start();
    }

}
